home *** CD-ROM | disk | FTP | other *** search
- TABLE OF CONTENTS
-
- openurl.library/--background--
- openurl.library/--rexxhost--
- openurl.library/URL_OpenA
- openurl.library/URL_GetPrefs
- openurl.library/URL_FreePrefs
- openurl.library/URL_SetPrefs
- openurl.library/URL_GetDefaultPrefs
- openurl.library/URL_LaunchPrefsApp
- openurl.library/--background-- openurl.library/--background--
-
- PURPOSE
- The openurl.library provides a means whereby developers
- can easily add "send URL to browser" functionality their
- applications.
-
- Users may configure their preferred browser(s) through the
- preference program.
-
- To utilise the library, you only need the URL_Open() call. All
- other functioncalls are only useful if you're making a
- preferences program.
-
- If you want to program your own preferences program, read this
- documentation and study the included source to the MUI
- preference program. If you have any questions, contact me.
-
- Troels Walsted Hansen
- troels@thule.no
- Ultima Thule Software
-
- openurl.library/--rexxhost-- openurl.library/--rexxhost--
-
- HOST INTERFACE
- openurl.library provides an ARexx function host interface that
- enables ARexx programs to use it. The functions provided by the
- interface are directly related to the functions described herein,
- with the differences mostly being in the way they are called.
-
- The function host library vector is located at offset -66 from
- the library. This is the value you provide to ARexx in the
- AddLib() function call. Note that this is different from the
- usual -30 offset of other libraries! Also, be sure to ask for
- version 3 of the library when you AddLib() it. See below for
- an example of how to use it properly.
-
- FUNCTIONS
- success = OPENURLPREFS()
-
- success = OPENURL(URL/A,SHOW/S,NOSHOW/S,TOFRONT/S,NOTOFRONT/S,NEWWIN/S,
- NONEWWIN/S,LAUNCH/S,NOLAUNCH/S)
-
- EXAMPLE
- /* OpenURL.rexx */
- PARSE ARG url
- OPTIONS RESULTS
-
- /* Load the openurl.library as a function host */
- IF ~SHOW('L','openurl.library') THEN
- CALL ADDLIB('openurl.library',3,-66)
-
- IF url="" THEN DO
- SAY "Usage:"
- SAY " rx OpenURL <url>"
- EXIT
- END
-
- SAY "Opening URL in new browser window..."
- success = OpenURL(url, SHOW, TOFRONT, NEWWIN, LAUNCH)
-
- IF success=0 THEN
- SAY "Failed to open URL"
- ELSE
- SAY "Succeeded in opening URL"
-
- SAY "Launching OpenURL prefs program..."
- success = OpenURLPrefs()
-
- IF success=0 THEN
- SAY "Failed to launch OpenURL prefs program"
- ELSE
- SAY "Succeeded in launching OpenURL prefs program"
-
- EXIT
- openurl.library/URL_OpenA openurl.library/URL_OpenA
-
- NAME
- URL_OpenA - Open an URL by sending it to a browser. (V1)
-
- SYNOPSIS
- success = URL_OpenA(url, tags)
- d0 a0 a1
-
- BOOL URL_OpenA(STRPTR, struct TagItem *);
-
- success = URL_Open(url, firsttag, ...)
-
- FUNCTION
- Open URL, optionally uniconify browser, bringing its screen to
- front, opening the URL in a new browser window and launching the
- browser if it isn't running.
-
- INPUTS
- url - The URL.
- tags - see below for allowed ones.
-
- TAGS
- The defaults shown next to each tag is the "default default",
- users may configure their own defaults starting with V2.
-
- URL_Show (BOOL) - show/uniconify browser, default TRUE.
-
- URL_BringToFront (BOOL) - bring browser to front, default TRUE.
-
- URL_NewWindow (BOOL) - open URL in new window, default FALSE.
-
- URL_Launch (BOOL) - launch browser when not running, default
- TRUE.
-
- RETURNS
- Returns TRUE for success, and FALSE for failure to contact/start
- any browser.
-
- NOTES
- From V2, the ARexx commands used to display URLs are sent
- asynchronously, in other words, the functions returns
- immediatedly, even if the browser is slow in replying the ARexx
- message, or possibly crashed and not replying at all.
-
- EXAMPLE
- See the included OpenURL.c.
-
- openurl.library/URL_GetPrefs openurl.library/URL_GetPrefs
-
- NAME
- URL_GetPrefs - Get a copy of openurl.library preferences. (V1)
-
- SYNOPSIS
- prefs = URL_GetPrefs()
- d0
-
- struct URL_Prefs *URL_GetPrefs(VOID);
-
- FUNCTION
- Get a copy of openurl.library preferences. Call this to get
- your own copy of the preferences to read from. When you're
- done, have URL_FreePrefs() free it.
-
- INPUTS
- none
-
- RETURNS
- Returns a valid pointer to a URL_Prefs structure, or NULL for
- failure.
-
- NOTES
- Remember to check the version number of the structure you get in
- return! Do not make any assumptions about the structure if it
- doesn't match the version that you handle.
-
- SEE ALSO
- URL_FreePrefs() URL_SetPrefs()
-
- openurl.library/URL_FreePrefs openurl.library/URL_FreePrefs
-
- NAME
- URL_FreePrefs - Free a copy of openurl.library preferences. (V1)
-
- SYNOPSIS
- URL_FreePrefs(prefs)
- a0
-
- VOID URL_FreePrefs(struct URL_Prefs *);
-
- FUNCTION
- Free a copy of openurl.library preferences. Call this when you're
- done with the prefs that URL_GetPrefs() gave you.
-
- INPUTS
- prefs - pointer to URL_Prefs structure
-
- SEE ALSO
- URL_GetPrefs()
-
- openurl.library/URL_SetPrefs openurl.library/URL_SetPrefs
-
- NAME
- URL_SetPrefs - Set openurl.library preferences. (V1)
-
- SYNOPSIS
- success = URL_SetPrefs(prefs, permanent)
- d0 a0 d0
-
- BOOL URL_SetPrefs(struct URL_Prefs *, BOOL);
-
- FUNCTION
- Set openurl.library preferences. Call this when the user has
- finished editing the preferences and pressed Save or Use in your
- preference program.
-
- INPUTS
- prefs - pointer to URL_Prefs structure
- permanent - boolean, TRUE for save to disk (ENVARC), FALSE for
- save to ram (ENV)
-
- RETURNS
- TRUE for success, FALSE for error.
-
- NOTES
- The whole structure including linked list is copied, so you must
- free your own copy.
-
- SEE ALSO
- URL_GetPrefs()
-
- openurl.library/URL_GetDefaultPrefs openurl.library/URL_GetDefaultPrefs
-
- NAME
- URL_GetDefaultPrefs - Get a copy of the default openurl.library
- preferences. (V2)
-
- SYNOPSIS
- prefs = URL_GetDefaultPrefs()
- d0
-
- struct URL_Prefs *URL_GetDefaultPrefs(VOID);
-
- FUNCTION
- Get a copy of the default openurl.library preferences. Call
- this to get your own copy of the preferences to read from.
- When you're done, have URL_FreePrefs() free it.
-
- INPUTS
- none
-
- RETURNS
- Returns a valid pointer to a URL_Prefs structure, or NULL for
- failure.
-
- NOTES
- Remember to check the version number of the structure you get in
- return! Do not make any assumptions about the structure if it
- doesn't match the version that you handle.
-
- SEE ALSO
- URL_FreePrefs() URL_SetPrefs()
-
- openurl.library/URL_LaunchPrefsApp openurl.library/URL_LaunchPrefsApp
-
- NAME
- URL_LaunchPrefsApp - Launch openurl.library prefs program (V3)
-
- SYNOPSIS
- success = URL_LaunchPrefsApp()
- d0
-
- BOOL URL_LaunchPrefsApp(VOID)
-
- FUNCTION
- Use this function if you want to offer a way to configure
- openurl.library from inside your application.
-
- INPUTS
- none
-
- RETURNS
- TRUE for success, FALSE for error.
-
-